package com.wing.order.model.response;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.wing.cabinet.model.entity.Cabinet;
import com.wing.cabinet.utils.ExcelExport;
import com.wing.order.model.entity.OrderReceiveLoad;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 下货数量VO
 *
 * @author
 */
@Data
@NoArgsConstructor
@Accessors(chain = true)
public class OrderReceiveUnloadVO {

    /**
     * ID
     */
    private Long id;

    /**
     * 创建时间
     */
    @JsonFormat(timezone = "GMT+8" , pattern = "yyyy-MM-dd HH:mm:ss" )
    @ExcelExport(value = "下货时间",sort = 150)
    private LocalDateTime createTime;

    /**
     * 创建者
     */
    private Long creator;

    /**
     * 修改者
     */
    private Long modifier;

    /**
     * 创建人
     */
    @ExcelExport(value = "下货人",sort = 140)
    private String creatorName;

    /**
     * 修改人
     */
    private String modifierName;

    /**
     * 领货单id
     */
    private Long receiveId;

    /**
     * 领货明细id
     */
    private Long receiveDetailId;

    /**
     * 下货数量
     */
    @ExcelExport(value = "数量（包装计）",sort = 100)
    private Integer quantity;

    @ExcelExport(value = "包装规格", sort = 90)
    private String packName;
    //@ExcelExport(value = "基础单位数量", sort = 13)
    private Integer baseRate;
    @ExcelExport(value = "数量(基础单位计)", sort = 120)
    private Integer quantityPack;
    @ExcelExport(value = "基础单位", sort = 130)
    private String basicsUnitName;

    private String packUnitName;

    /**
     * 柜子编码
     */
    @ExcelExport(value = "柜子编号",sort = 60)
    private String cabCode;

    /**
     * 货道编号
     */
    @ExcelExport(value = "货道编号",sort = 80)
    private String spaceCode;

    /**
     * skuCode
     */
    @ExcelExport(value = "物料编号",sort = 20)
    private String skuCode;

    /**
     * sku 名称
     */
    @ExcelExport(value = "物料名称",sort = 10)
    private String skuName;



    /**
     * sku 规格
     */
    private String skuSpec;

    /**
     * sku 图片
     */
    private String skuPic;

    /**
     * 产品类型名称
     */
    private String productTypeName;

    /**
     * 产品分类名称
     */
    private String productCategoryName;

    /**
     * 产品品牌
     */
    @ExcelExport(value = "品牌",sort = 40)
    private String productBrandName;

    /**
     * 产品型号
     */
    private String productModelName;


    /**
     * 市场价
     */
    private BigDecimal marketPrice;



    /**
     * 单号
     */
    @ExcelExport(value = "下货单号",sort = 50)
    private String code;

    private Integer day;

    private Integer no;

    //@ExcelExport(value = "下/下货类型",sort = 2,kv = "replenishment-补货下货;selfLoad-自主下货;selfLoadSimple-自主下货;selfUnloadSimple-自主下货")
    private OrderReceiveLoad.Type type;

    private String receiveCode;

    //@ExcelExport(value = "配货需求单",sort = 3)
    private String demandCode;

    //@ExcelExport(value = "下/下货计划单",sort = 4)
    private String loadPlanCode;

    private String typeDesc;

    public String getTypeDesc(){
        if (type!=null){
            return type.getDesc();
        }
        return null;
    }

    private Long cabId;

    private Long spaceId;

    private Long skuId;
    /**
     * 规格
     */
    @ExcelExport(value = "规格码",sort = 30)
    private String skuSpecOld;
    /**
     * 单位
     */
    @ExcelExport(value = "包装单位", sort = 110)
    private String unitName;

    private String skuCodeOld;


    /**
     * 刀柜类型
     */
    private Cabinet.CabinetType cabinetType;

    /**
     * 企业自定义柜子名称
     */
    @ExcelExport(value = "企业自定义名称",sort = 70)
    private String cabName;

    private String enterpriseCode;
    @ExcelExport(value = "部门",sort = 51)
    private String departmentName;
    @ExcelExport(value = "成本中心",sort = 52)
    private String costCenter;
    private String roleName;

    private Long departmentId;

}
